using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace RenameX.Models
{
    public class FileItem : INotifyPropertyChanged
    {
        private string _originalPath = string.Empty;
        private string _originalName = string.Empty;
        private string _newName = string.Empty;
        private string _newExtension = string.Empty;
        private bool _isSelected;
        private bool _isConflict;

        public string OriginalPath
        {
            get => _originalPath;
            set { if (_originalPath != value) { _originalPath = value; OnPropertyChanged(); } }
        }

        public string OriginalName
        {
            get => _originalName;
            set { if (_originalName != value) { _originalName = value; OnPropertyChanged(); } }
        }

        public string NewName
        {
            get => _newName;
            set { if (_newName != value) { _newName = value; OnPropertyChanged(); } }
        }

        public string NewExtension
        {
            get => _newExtension;
            set { if (_newExtension != value) { _newExtension = value; OnPropertyChanged(); } }
        }

        public bool IsSelected
        {
            get => _isSelected;
            set { if (_isSelected != value) { _isSelected = value; OnPropertyChanged(); } }
        }

        public bool IsConflict
        {
            get => _isConflict;
            set { if (_isConflict != value) { _isConflict = value; OnPropertyChanged(); } }
        }

        public event PropertyChangedEventHandler? PropertyChanged;

        protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


